package com.iwhalecloud.bss.kite.cucc.web.service;

import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.iwhalecloud.bss.kite.client.dto.DataResult;
import com.iwhalecloud.bss.kite.client.dto.cust.CustDTO;
import com.iwhalecloud.bss.kite.client.dto.spec.in.ContractOfferDetailDTO;
import com.iwhalecloud.bss.kite.client.vo.scene.ProdRoleModuleVO;
import com.iwhalecloud.bss.kite.cucc.client.dto.cust.CuccContextCustDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosCustomerDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosDTO;
import com.iwhalecloud.bss.kite.cucc.web.service.accept.vo.InitSceneVO;
import com.iwhalecloud.bss.kite.manager.dto.KiteAttrDTO;

public interface ISceneService {

	/**
	 * 根据订单详情创建场景
	 * @param orderId
	 * @param serviceOfferId
	 * @param custId
	 * @param custName
	 * @param staffId
	 * @param lanId
	 * @param regionId
	 * @return
	 */
	DataResult<String> createOfferScene(String serialNumber, String prodId, String serviceOfferId, String custId, String custName,
            String staffId, String lanId, String regionId, String userId);

    /**
     * 根据订单详情创建场景
     * @param orderId
     * @param serviceOfferId
     * @param custId
     * @param custName
     * @param staffId
     * @param lanId
     * @param regionId
     * @return
     */
    DataResult<String> createOfferSceneByOrderDetailInfo(String orderId, String serviceOfferId, String custId, String custName,
                                             String staffId, String lanId, String regionId, String operType);


    /**
     * 根据工单信息创建场景（工单ID和任务ID必传一个）
     *
     * @param orderId 订单ID
     * @param flowId 工单ID
     * @param taskId 任务ID
     * @param serviceOfferId
     * @param custId
     * @param custName
     * @param staffId
     * @param lanId
     * @param regionId
     * @return
     */
    DataResult<String> createOfferSceneByWorkOrder(String orderId, String flowId, String taskId, String serviceOfferId, String operType, String custId, String custName,
                                            String staffId, String lanId, String regionId);


    /**
     * 根据工单信息创建场景（工单ID和任务ID必传一个）
     * 增加一个订单来源参数
     * @param orderId 订单ID
     * @param flowId 工单ID
     * @param taskId 任务ID
     * @param serviceOfferId
     * @param custId
     * @param custName
     * @param staffId
     * @param lanId
     * @param regionId
     * @param orderSource
     * @param toOrderType 代办类型，标识代办方式收费收费方预销户
     * @return
     */
    DataResult<String> createOfferSceneByWorkOrder(String orderId, String flowId, String taskId, String serviceOfferId,
        String operType, String custId, String custName, String staffId, String lanId, String regionId,
        String orderSource, String toOrderType, String preTaskCode);

	/**
	 * 初始化成员商品
	 * @param sceneInstId
	 * @param offerVO
	 */
	void initMemberOffers(String sceneInstId, List<ContractOfferDetailDTO> memberOffers);

    /**
	 * 更新属性值
	 * @param sceneInstId
	 * @param attrs
	 * @param offerInstId
	 */
	void updateInstAttr(String sceneInstId, List<KiteAttrDTO> attrs, String offerInstId);

    /**
     * 根据订单信息/用户信息创建场景
     * @param serviceOfferId 服务提供
     * @param operType 操作类型
     * @param askSource 订单来源
     * @param custId
     * @param custName
     * @param staffId
     * @param lanId
     * @param regionId
     * @param kitePosDTO
     * @return
     */
	String createOfferScene(String serviceOfferId, String operType, String askSource, String custId, String custName,
                            String staffId, String lanId, String regionId, KitePosDTO kitePosDTO, String preTaskCode);

    DataResult<ProdRoleModuleVO> getProdRoleModuleVO(String roleId, String prodId, String prodInstId, String templateId, String offerId);

    /**
     * 打印模板
     * @param sceneInstId
     * @param serviceOfferId
     * @return
     */
    Map<String, Object> dealPrintTemplate(String sceneInstId, String serviceOfferId);
    /**
     * 回显订单概要信息
     * @param orderId
     * @param sceneInstId
     * @param orderData
     * @param worksheetData
     * @return
     */
    void queryOrderSummaryInfo(String orderId, String sceneInstId, KitePosDTO kitePosDTO, JSONObject orderData, Map<String, Object> worksheetData);


    void initContext(KitePosCustomerDTO customer);


    DataResult<InitSceneVO> getInitSceneVODataResult(String cartId, String accNum, String prodId,
        String serviceOfferId, String userId, String flag);

    void cacheShoppingCartGroup(String sceneInstId, String cartId);

    void setSceneInstId(String sceneInstId, String cartId, String operType);


    DataResult<InitSceneVO> initOfferSceneByOrderDetailInfo(String orderId,
        String serviceOfferId, String businessType, String cartId, String preTaskCode);

    DataResult<InitSceneVO> initOfferSceneByWorkOrder(String orderId, String flowId, String taskId,
        String serviceOfferId, String operType, String orderSource, String cartId,
        Map<String, Object> orderInfo, String toOrderType,
        Map<String, Object> dataMap);

    CustDTO transToCustDTO(CuccContextCustDTO cuccCustInfoDTO);
}
